﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XLua;
using System.IO;
public class DefineLoader : MonoBehaviour {

	// Use this for initialization
	void Start () {
        LuaEnv env = new LuaEnv();
        env.AddLoader(MyLoader);
        //test007将作为参数传入filepath
        env.DoString("require 'test007'");
        env.Dispose();
     
       
	}
    private byte[] MyLoader(ref string filepath)
    {
        string abspath = Application.streamingAssetsPath + "/" + filepath + ".lua.txt";
        return System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(abspath));
    }
	
	
}
